<@_category id=id>
	<#assign category=object/>
	<#assign attribute=getCategoryAttribute(id)/>
</@_category>
<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="utf-8">
	<title>${(category.name)!}</title>
	<meta name="keywords" content="${(attribute.keywords)!}"/>
	<meta name="description" content="${(attribute.description)!}"/>
</head>
<body>
	<header>
		<h1>${(site.name)!}</h1>
	</header>
	<nav>
		<a href="${base}">首页</a>
<@_categoryList>
	<#list page.list as a>
		<a href="${a.url!}" target="_blank">${a.name}</a>
	</#list>
</@_categoryList>
	</nav>
<#if category?has_content>
	<main>
		<h1>最新内容</h1>
<@_contentList categoryId=category.id containChild=true pageIndex=pageIndex count=category.pageSize>
	<#list page.list as a>
		<article>
		    <h3><a href="<#if a.onlyUrl>${site.dynamicPath}content/redirect.do?id=${a.id}<#else>${a.url!}</#if>" target="_blank">${a.title}</a></h3>
		    <p>
		    	<#if a.cover?has_content><img src="${site.sitePath+a.cover}" alt="${a.title}"/></#if>
		    	${a.description!}
		    </p>
		</article>
	</#list>
		<div>
			<#if !page.firstPage>
				<a href="?id=${id}&pageIndex=${page.prePage}">上一页</a>
			<#else>
				<span>上一页</span>
			</#if>
			<#assign start=1/>
			<#if (page.pageIndex-5) gt start>
				<#assign start=page.pageIndex-4/>
			</#if>
			<#assign end=page.totalPage/>
			<#if (page.pageIndex+5) lt end>
				<#assign end=page.pageIndex+4/>
			</#if>
			<#if start gt 1>
				<a href="?id=${id}">1</a> ...
			</#if>
			<#list start..end as n>
				<#if n=page.pageIndex>
					${n}
				<#else>
					<a href="?id=${id}&pageIndex=${n}">${n}</a>
				</#if>
			</#list>
			<#if end lt page.totalPage>
				... <a href="?id=${id}&pageIndex=${page.totalPage}">${page.totalPage}</a>
			</#if>
			<#if !page.lastPage>
				<a href="?id=${id}&pageIndex=${page.nextPage}">下一页</a>
			<#else>
				<span>下一页</span>
			</#if>
		</div>
</@_contentList>
		<aside>
			<h3>热门内容</h3>
			<ul>
<@_contentList categoryId=category.id containChild=true orderField='clicks' count=10>
	<#list page.list as a>
				<li><a href="<#if a.onlyUrl>${site.dynamicPath}content/redirect.do?id=${a.id}<#else>${a.url!}</#if>" target="_blank">${a.title}</a><span>${a.clicks}</span></li>
	</#list>
</@_contentList>
			</ul>
		</aside>
	</main>
<#else>
	<main>
		<h2>没有此分类</h2>
	</main>
</#if>
	<footer>
		Copyright &copy; ${.now?string('yyyy')}
	</footer>
</body>
</html>